package com.chenzhengrong.demospringboot.domain.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.chenzhengrong.demospringboot.domain.pojo.PartyOrganization;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author chenzhengrong
 * @title: PartyTree
 * @description: PartyTree
 * @date 2022/11/17 16:45
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PartyTree {

    /**
     * 主键id
     */
    private Integer id;

    /**
     * 父id
     */
    private Integer pid;

    /**
     * 所属党（工）委
     */
    private String pname;

    /**
     * 等级
     */
    private Integer grade;

    /**
     * 党组织名称
     */
    private String name;

    private List<PartyTree> treeList;

    public PartyTree(PartyOrganization partyOrganization) {
        this.id = partyOrganization.getId();
        this.pid = partyOrganization.getPid();
        this.pname = partyOrganization.getPname();
        this.grade = partyOrganization.getGrade();
        this.name = partyOrganization.getName();
    }
}
